package org.example.mapper;

import org.apache.ibatis.annotations.Param;
import org.example.domain.po.ErpMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
* @author DELL
* @description 针对表【erp_menu(功能模块表)】的数据库操作Mapper
* @createDate 2024-10-11 10:34:47
* @Entity org.example.domain.po.ErpMenu
*/
public interface ErpMenuMapper extends BaseMapper<ErpMenu> {
    
    /**
     * 管理员使用的菜单(树形)
     */
    List<ErpMenu> findMenusAdminTree(@Param("parentId")Integer parentId, @Param("cname")String cname);
    
    /**
     * 根据用户ID查询菜单(树形)
     * @param userId 用户ID
     * @param parentId 菜单ID
     */
    List<ErpMenu> findMenuByUserIdTree(@Param("userId") Long userId,
                                      @Param("parentId") Long parentId);
    
    
    /**
     * 根据用户ID查询菜单功能
     * @param userId 用户ID
     */
    List<ErpMenu> findMenusByUserId(Long userId);
    
    /**
     * 根据用户ID查询菜单（不包括顶级菜单）
     * @param userId 用户ID
     */
    List<ErpMenu> getMenusByUserId(Long userId);
    
    List<ErpMenu> findMenusRoleId(@Param("roleId")Long roleId, @Param("tenantId") Long tenantId);
    
    List<ErpMenu> queryMenuByParentId(Long menuId);
    
    List<ErpMenu> findMenuTree(Long menuId);
    
    List<ErpMenu> findMenus(Long menuId);
}




